#ifndef IO_H
#define IO_H

#include "memdb.h"


/************************************************************************/
/* Summary:	Write database and its data to file
/* Return:	If database is written to file successfully, return SUCCESS; or return other error_code
/* param0:	pointer to the database
/* param1:	pointer to the file
/* param2:	
/* Author:	ShiWen
/* Date:	2010-5-20
/* Revise:	
/************************************************************************/
Error_code write_db_to_file(struct database* p_db, FILE* fp);

/************************************************************************/
/* Summary:	read database and its data from file
/* Return:	If database is read from file successfully, return SUCCESS; or return other error_code
/* param0:	pointer to the database; this pointer must be allocated memroy
/* param1:	pointer to the file
/* param2:	
/* Author:	ShiWen
/* Date:	2010-5-20
/* Revise:	
/************************************************************************/
Error_code read_db_from_file(struct database* p_db, FILE* fp);

#endif